<template>
	<div>
	<div v-for="(item,index) in phonepagedata" :key="index">
		<div v-html="item.div?item.div:''" @click="clickedit(item,index)"></div>
		<component :is="item.component" v-if="item.component?true:false"
		:customtext="item.customtext"
		:lunbotu="item.swiperimg" 
		:dantu="item.dantuimg" 
		:gonggao="item.gonggaotext"
		:eyegzh="item.eyegzhtext"
		:tuwennav="item.tuwennavimg"
		@click.native="clickedit(item,index)">
		</component>
	</div>
	</div>
</template>

<script>
	import {getPhonePageData} from "../../api/index.js"
	import xjsearch from '@/components/shop/xjsearch.vue';
	import xjsearchedit from '@/components/shop/xjsearchedit.vue';
	import xjcustomtext from '@/components/shop/xjcustomtext.vue';
	import xjcustomtextedit from '@/components/shop/xjcustomtextedit.vue';
	import xjlunbotu from '@/components/shop/xjlunbotu.vue';
	import xjlunbotuedit from '@/components/shop/xjlunbotuedit.vue';
	import xjdantu from '@/components/shop/xjdantu.vue';
	import xjdantuedit from '@/components/shop/xjdantuedit.vue';
	import xjgonggao from '@/components/shop/xjgonggao.vue';
	import xjgonggaoedit from '@/components/shop/xjgonggaoedit.vue';
	import xjeyegzh from '@/components/shop/xjeyegzh.vue';
	import xjeyegzhedit from '@/components/shop/xjeyegzhedit.vue';
	import xjtuwennav from '@/components/shop/xjtuwennav.vue';
	import xjtuwennavedit from '@/components/shop/xjtuwennavedit.vue';
	export default {
		components: {
			xjsearch,
			xjsearchedit,
			xjcustomtext,
			xjcustomtextedit,
			xjlunbotu,
			xjlunbotuedit,
			xjdantu,
			xjdantuedit,
			xjgonggao,
			xjgonggaoedit,
			xjeyegzh,
			xjeyegzhedit,
			xjtuwennav,
			xjtuwennavedit
		},
	  data(){
		return{
			phonepagedata:""
		}  
	  },
	 methods:{
		 getPhonePageData(){
			  let shopdataid=localStorage.getItem('shopdataid')?localStorage.getItem('shopdataid'):"";
			  if(!shopdataid){
			  	return;
			  }
			  getPhonePageData({shopdataid}).then((res)=>{
			  	if(res.code==1){
			  		this.phonepagedata=res.data;
			  	}else{
			  		console.log("获取手机页面数据失败");
			  	}
			  })
		 }
	 },
     created(){
		 this.getPhonePageData();
	 }

}
</script>

<style>
</style>
